import request from "@/utils/request";

// 登录方法
export function login(data) {
  return request({
    url: "/api/front/auth/login",
    headers: {
      isToken: false,
      repeatSubmit: false,
    },
    method: "post",
    data: data,
  });
}

// 注册方法
export function register(data) {
  return request({
    url: "/api/front/auth/register",
    headers: {
      isToken: false,
    },
    method: "post",
    data: data,
  });
}

// 退出方法
export function logout() {
  return request({
    url: "/api/front/auth/logout",
    method: "post",
  });
}
// 退出方法
export function getInfo() {
  return request({
    url: "/api/front/auth/info",
    method: "get",
  });
}
// 获取旧邮箱验证码
export function sendOldCode() {
  return request({
    url: "/api/front/user/email/send-change-old-code",
    method: "post",
  });
}
// 验证邮箱验证码
export function verifyCode(data) {
  return request({
    url: "/api/front/auth/email/verify-code",
    headers: {
      isToken: false,
    },
    method: "post",
    data: data,
  });
}
